package com.sphd.emanu.adapter;

import android.support.annotation.LayoutRes;
import android.support.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.sphd.emanu.R;
import com.sphd.emanu.pojo.login.UserMessage;
import com.wzutils.TimeUtils;

import java.util.List;

/**
 * @Author Hu
 * @Time 2017/7/27 --10:04.
 * @Email 87683202@qq.com
 */
public class MsgAdapter extends BaseQuickAdapter<UserMessage, BaseViewHolder> {
    public MsgAdapter(@LayoutRes int layoutResId, @Nullable List<UserMessage> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, UserMessage item) {
        helper
                .setText(R.id.item_msg,item.getContent())
                .setText(R.id.item_order_time,"下单时间:"+ TimeUtils.dateToString(item.getSendTime(),TimeUtils.YEAR_MONTH_DAY_HOUR_MIN))
                .setText(R.id.item_title,item.getTitle());
    }
}
